﻿using LPLS.DBEntities.ConfigModels.DataCollectionConfigModule.DataCollectionType.PLC;
using Opc.Ua.Client;
using OPCUA.Common;

namespace LPLS.CollectionHardProtocol.OPCUAModules.OPCUABAseModule
{
    public abstract class OPCUABaseDTO
    {

    
        /// <summary>
        /// 设备ID
        /// </summary>
        public Guid DeviceID { get; set; }
        /// <summary>
        /// 部件ID
        /// </summary>

        public Guid CompentID { get; set; }
        /// <summary>
        /// OPCUAID OPCUA的标识
        /// </summary>

        public Guid OPCUAID { get; set; }
        /// <summary>
        /// 在线标志  
        /// </summary>
        public  bool IsActived { get; set; }    

       /// <summary>
       /// 认证方式  0:匿名  2:用户登录  3： 证书登录
       /// </summary>
        public int AuthenticationMethod { get; set;  }

        public string OPCUAName { get; set;  }

        /// <summary>
        /// OPCUA的Client
        /// </summary>
        public MyOPUAHelper OPCUAClient { get; set; }

        public  string JsonName { get; set; }


        public string Url { get; set;  }
        /// <summary>
        /// 节点
        /// </summary>
        public List<string> Nodes { get; set; }=new List<string> ();


        public     List<PLCVarPropertyConfig> PLCVarList { get; set; } = new List<PLCVarPropertyConfig>();
        public string GroupName { get; set; }

        public abstract void SubCallBackContinue(string key, MonitoredItem monitoredItem, MonitoredItemNotificationEventArgs args);

        public  void SubCallback(string key, MonitoredItem monitoredItem, MonitoredItemNotificationEventArgs args) 
        {

            SubCallBackContinue(key,  monitoredItem,  args);

        }

        public abstract void BatchRead();


    }

   

    public class AlarmNode 
    { 
    /// <summary>
    /// 指令
    /// </summary>
        public  string NodeID { get; set; }
        /// <summary>
        /// 索引值
        /// </summary>
        public int index { get; set; }
    /// <summary>
    /// 值
    /// </summary>
        public string Value { get; set; }
    
    }
}
